<!DOCTYPE html>
<form>
    <div>
        <script>
            var d = document.querySelector('div');
            d.parentNode.removeChild(d);
        </script>
        <input>
    </div>
</form>
<script src="../../resources/js-test.js"></script>
<script>
description('FormAssociatedElements should not be associated with forms in different trees (and should not crash)');
var unused = document.forms[0].elements.length;
d = null;
gc();
shouldBeUndefined('document.forms[0].elements[0]');
</script>
